package day04;

import java.util.Scanner;

public class WhieDemo {
    public static void main(String[] args) {
        Scanner x = new Scanner(System.in);
        int y = (int) (Math.random()*100+1);
        System.out.println("游戏开始");
        int z = x.nextInt();
        while (z != y){
            if (z>y){
                System.out.println("数字大了，请继续猜");
            }else if (z<y){
                System.out.println("数字小了，请继续猜");
            }
            z = x.nextInt();
        }
        System.out.println("恭喜你猜对了,答案是"+y);
    }
}
